-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[7주차 기본 과제] 🌈 카드게임 리팩토링 #8
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉 언니 너어ㅓ어어어무 잘했는데....?!!????!!!! 진짜 클린코드 그잡채!!!!!!!!!!
컴포넌트 분리도 넘 잘했구 카드 랜덤배치, 전역상태관리, 구조분해할당 등등등 진짜 깔끔하다!!! 3D 속성까지 쓰구!! 나도 언니 코드 보고 배워가 ㅎㅎㅎ
언니 갈수록 진짜 처음보다 완전완전 짱많이 성장한거가타!!!!!!! 나도 완전 자극 받아써 +_+
마지막 과제까지 넘 수고 많았어!!! ㅜㅜ 앱잼도 화이팅이야💙💙
interface CardProps { | ||
imageSrc?: string; | ||
imageName: string; | ||
onClick: () => void; | ||
isOpen: boolean; | ||
} | ||
|
||
function Card({ imageSrc, onClick, isOpen, imageName }: CardProps) { | ||
return ( | ||
<CardWrapper isOpen={isOpen} onClick={onClick}> | ||
<CardInner isOpen={isOpen}> | ||
<FrontArticle> | ||
<Image src={imageSrc} alt={imageName} isOpen={isOpen} /> | ||
</FrontArticle> | ||
<BackArticle> | ||
<Image | ||
src="https://www.svgrepo.com/show/454281/cat-halloween-kitty.svg" | ||
alt="default cat" | ||
/> | ||
</BackArticle> | ||
</CardInner> | ||
</CardWrapper> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
머야 넘 깔꼼쓰!!
cursor: pointer; | ||
} | ||
&.open { | ||
box-shadow: 7px 7px papayawhip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이색깔 처음봥 ㅋㅋㅋㅋㅋ 이름 귀엽다 ㅜㅜ
export default Card; | ||
|
||
const CardWrapper = styled.section` | ||
perspective: 1000px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
옹 3D요소 원근효과 주는 속성!!!!! 첨 알았땅!!!
height: 240px; | ||
padding: 5px; | ||
transform: rotateY(180deg); | ||
backface-visibility: hidden; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헐 일케 앞뒷면 보이게 구현한거구나....... 대박 이것도 첨알았어 너무신기해!!!!!3D!!!!!!!!!!
const CardInner = styled.article` | ||
position: relative; | ||
transition: transform 0.6s; | ||
transform-style: preserve-3d; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
폼 미쳤다... 이런거 대체 어디서!!!!! 찾는거야!!!!!!!
return ( | ||
<Section> | ||
{modes.map((eachMode) => ( | ||
<Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type도 넣어주장!!
function Reset({ resetGame }: ResetProps) { | ||
return ( | ||
<Section> | ||
<Button onClick={resetGame}>Reset</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요기두 type ㅎㅎㅎ
import React from "react"; | ||
|
||
interface ResetProps { | ||
resetGame: () => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에는 handle~ 이런식으루 함수 네이밍햇는데 요긴 그냥 resetGame 으로 한 이유가 이써!?
if (mode === "EASY") { | ||
setTotalCardCount(5); | ||
} else if (mode === "NORMAL") { | ||
setTotalCardCount(7); | ||
} else if (mode === "HARD") { | ||
setTotalCardCount(9); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 switch-case 써두 되겠당!!!ㅎㅎ
const allCatsRandom: string[] = cat | ||
.sort(() => Math.random() - 0.5) | ||
.slice(0, totalCardCount) | ||
.map((eachCat) => eachCat.name); | ||
|
||
setTotalCard( | ||
[...allCatsRandom, ...allCatsRandom].sort(() => Math.random() - 0.5) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
크 넘조타
✨ 구현 기능 명세
🌼 PR Point
atom 으로 state 관리🌐
recoil 폴더와 atom폴더를 새로 만들어서 atom을 따로 정리해뒀습니다!🗂️
🥺 소요 시간, 어려웠던 점
🌈 구현 결과물